/*
*	(*^。^*) TFrameWork License (*^。^*)
*/

/*
 *  Title :  
 *          
 *  Description :  
 *          
 *          
 *  Date : 
 *
 *  Author : DengPing
 *
 *  Modify : 
 */

using System;
using UnityEngine;

namespace TFrameWork.Module.ActionEditor
{
    [System.Serializable]
    public abstract class TrackEventBase : DataBase
    {
        /// <summary>
        /// 事件名称
        /// </summary>
        public string trackName = "";

        /// <summary>
        /// 事件起始点
        /// </summary>
        public int internalstartIndex;

        public int startIndex
        {
            get { return internalstartIndex; }
            set
            {
                internalstartIndex = value;
                OnChangeIndex?.Invoke();
            }
        }

        /// <summary>
        /// 持续帧
        /// </summary>
        public int internaldurationIndex;

        public int durationIndex
        {
            get { return internaldurationIndex; }
            set { internaldurationIndex = value; }
        }

        [HideInInspector] public Action OnChangeIndex;

        public override object Clone()
        {
            var clone = base.Clone() as TrackEventBase;
            clone.trackName = trackName;
            clone.internalstartIndex = internalstartIndex;
            clone.internaldurationIndex = internaldurationIndex;
            clone.OnChangeIndex = OnChangeIndex;
            return clone;
        }
    }
}
